from wormbane.model.armor import Armor
from wormbane.model.race import Race
from wormbane.model.weapon import Weapon
from wormbane.util.random_ import percent_chance, weighted_choice

class Titan(Race):
    size = 'huge'

    # Jane Ellen Harrison, Themis, p. 16ff. "The Titans then, the
    # white-clay-men, are real men dressed up as bogies to perform initiation
    # rites. It is only later when their meaning is forgotten that they are
    # explained as Titanes, mythological giants."
    color = 'white'

    health = 6

    @classmethod
    def create_equipment(cls):
        def random_metal():
            return weighted_choice(adamant = 1, titanium = 99)

        yield Weapon(kind = 'hammer', material = random_metal())
        for kind in ('armor', 'boots', 'helm', 'gloves', 'shield', 'shirt'):
            if percent_chance(50):
                yield Armor(kind = kind, material = random_metal())
